<%-- 
    Document   : index
    Created on : Apr 7, 2013, 9:26:15 PM
    Author     : TNT
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%> 
<%@page import="RMI.Client" %>
<%@page import="java.sql.*" %>
<!DOCTYPE html>
<html>
    <head>
        <link rel="shortcut icon" href="image/icon.png">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="Style.css" rel="stylesheet" type="text/css">
        
        <title>Mobile Store</title>
    </head>
    <body bgcolor="#CCFFFF">
        
  <TABLE width="1024" height="768" border=0 cellSpacing=0 cellPadding=0 align=center bgcolor ="white">
  <tr>
      <td colspan="5"><div align="center"><a href ="index.jsp"> <img src ="image/banner.jpg" width ="1024px" height="150" ></a></div></td>
  </tr>
  <tr>
    <td colspan="5"><%@include file="menu_ngang.jsp" %></td>
  </tr>
  <tr>
      <td width="150" vAlign=top bgcolor ="silver" ><div align ="center"><%@include file="menu_doc.jsp" %></div></td>
    <td width="4">&nbsp;</td>
    <td width="720" vAlign=top >
        <table width ="720px" border="0">
            <td><br><br></td>
            <%
                
                Client client = new Client();
                boolean connect = client.Connect();
                if(connect ==false)
                out.print("<h1 align = center ><img src = 'image/sorry.jpg'> <br>Không kết nối được cơ sở dữ liệu </h1>");
                else{
                String SP[] = client.LaySP();
                for(int i =0; i<SP.length;i++)
                if (SP[i]!=null){
                    String TT[] = SP[i].split("###");
                    if(i%3 == 0) out.println("<tr>");	
			out.println("<td width=240 align=center>"+"<img src="+TT[4]+" width=200><br>"
                                +TT[1]+"<br><font color=red>"+TT[2]+""
                                + "</font>"+"<br><a href="+"productdetail.jsp?ID="+TT[0]+">Chi tiết</a></td>");
			
			if(i+1%3 == 0) 
				out.println("</tr>");
                }
                }
            %>
        </table>
    </td>
    <td width="2">&nbsp;</td>
    <td width="150" vAlign=top ><%@include file="Right.jsp" %></td>
  </tr>
  <tr>
      <td colspan="5"><%@include file="bottom.jsp" %></td>
  </tr>
</TABLE>
</body>
</html>
